home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DRIVES.SWG / 0040_Last Drive.pas < prev    next >
Pascal/Delphi Source File  |  1993-08-27  |  620b  |  36 lines

  1. {
  2. ROB GREEN
  3.  
  4. > do any of you guys know how to figure out which drive is the last drive
  5. > on someone's system?  I was think of making a drive With Dos's
  6. }
  7.  
  8. Uses
  9.   Dos;
  10.  
  11. Function driveexist(ch : Char) : Boolean;
  12. begin
  13.   DriveExist := disksize(ord(upcase(ch)) - 64) <> - 1;
  14. end;
  15.  
  16.  
  17. { Kerry Sokalsky }
  18.  
  19. Const
  20.   exist : Boolean  = True;
  21.   ch    : Integer  = 67;   { 'C' - Skip floppy Drives (A&B) }
  22.   lastdrive : Char = ' ';
  23.  
  24. begin
  25.   While LastDrive = ' ' do
  26.   begin
  27.     if driveexist(Chr(ch)) then
  28.       Inc(Ch)
  29.     else
  30.       LastDrive := Chr(Ch - 1);
  31.   end;
  32.  
  33.   Writeln(LastDrive);
  34. end.
  35.  
  36.